package com.ssh.tts.service;

import java.util.List;

import com.ssh.tts.dao.UserDao;
import com.ssh.tts.model.IUser;

public class UserService {
	
	private UserDao userDao = new UserDao();
	/**
	 * 注册
	 * @param user
	 */
	public void register(IUser user) {
		int result = userDao.register(user);
		if (result < 0) {
			throw new RuntimeException("注册失败");
		}
	}
	
	public List<IUser> login(IUser user) {
		List<IUser> list = userDao.login(user);
		if (list.size() <= 0) {
			throw new RuntimeException("登陆失败");
		}
		return list;
	}
}
